package com.example.cs_jump.Util;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;

import androidx.annotation.Nullable;

public class Sqlite extends SQLiteOpenHelper {
    public Sqlite(@Nullable Context context) {
        super(context, "map.db", null, 1);
    }

    private static Sqlite instance=null;

    public synchronized static Sqlite getInstance(Context context){
        if (instance==null){
            instance=new Sqlite(context);
        }
        return instance;
    }

    @Override
    public void onCreate(SQLiteDatabase sql) {
        sql.execSQL("create table nuke (id varchar(20)," +
                "title varchar(30)," +
                "brief varchar(30)," +
                "tickrate varchar(30)," +
                "cover varchar(40))");
        sql.execSQL("create table dust (id varchar(20)," +
                "title varchar(30)," +
                "brief varchar(30)," +
                "tickrate varchar(30)," +
                "cover varchar(40))");
        sql.execSQL("create table cache (id varchar(20)," +
                "title varchar(30)," +
                "brief varchar(30)," +
                "tickrate varchar(30)," +
                "cover varchar(40))");
        sql.execSQL("create table inferno (id varchar(20)," +
                "title varchar(30)," +
                "brief varchar(30)," +
                "tickrate varchar(30)," +
                "cover varchar(40))");
        sql.execSQL("create table mirage (id varchar(20)," +
                "title varchar(30)," +
                "brief varchar(30)," +
                "tickrate varchar(30)," +
                "cover varchar(40))");
        sql.execSQL("create table overpass (id varchar(20)," +
                "title varchar(30)," +
                "brief varchar(30)," +
                "tickrate varchar(30)," +
                "cover varchar(40))");
        sql.execSQL("create table train (id varchar(20)," +
                "title varchar(30)," +
                "brief varchar(30)," +
                "tickrate varchar(30)," +
                "cover varchar(40))");
        sql.execSQL("create table vertigo (id varchar(20)," +
                "title varchar(30)," +
                "brief varchar(30)," +
                "tickrate varchar(30)," +
                "cover varchar(40))");
        sql.execSQL("create table collect (id varchar(20)," +
                "title varchar(30)," +
                "brief varchar(30)," +
                "tickrate varchar(30)," +
                "cover varchar(40))");
    }

    @Override
    public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i1) {

    }
}
